package CutLoad.transitions.cloud
{
	import CutLoad.Base;
	import CutLoad.transitions.Easing;
	
	import flash.display.DisplayObject;
	import flash.events.Event;
	/**
	 * 让目标影片缓动透明度为0变回1 
	 * @author Administrator
	 * 
	 */	
	public class EasingAlpha extends Base
	{
		private var easing:Easing;
		private var target:DisplayObject;
		public function EasingAlpha(target:DisplayObject,endSet:Number=1,offset:Number=0.001,startNum:Number=0,targetNum:Number=1)
		{
			target.alpha=0;
			var THIS:EasingAlpha=this;
			this.target=target;
			easing=new Easing(startNum,targetNum,endSet,offset);
			easing.setFunEnd(function(num:Number):void{
				target.alpha=1;
				THIS.removeEventListener(Event.ENTER_FRAME,enter_frame);
				THIS.killMe();
			});
			easing.setFunEnterFrame(function(num:Number):void{
				target.alpha=num
			});
			this.addEventListener(Event.ENTER_FRAME,enter_frame);
			easing.start();
		}
		private function enter_frame(e:Event):void{
			easing.enterFrame();
		}
	}
}